tkinter window

138

from tkinter import *

mywindow = Tk() #Change the name for every window you make
mywindow.title("New Project") #This will be the window title
mywindow.geometry("780x640") #This will be the window size (str)
mywindow.minsize(540, 420) #This will be set a limit for the window's minimum size (int)
mywindow.configure(bg="blue") #This will be the background color

mywindow.mainloop() #You must add this at the end to show the window
#Creating Tkinter Window In Python:

from tkinter import *

new_window = Tk() #Create a window ; spaces should be denoted with underscores ; every window should have a different name
new_window.title("My Python Project") #Name of screen ; name should be the one which you already declared (new_window)
new_window.geometry("200x150") #Resizes the default window size
new_window.configure(bg = "red") #Gives color to the background

new_window.mainloop() #Shows the window on the screen
from tkinter import *

root = Tk()
root.title("Hello World")
message_label = Label(root, text="Hello World")
message_label.pack()

root.mainloop()
import tkinter
master = tkinter.Tk()
master.mainloop()
Installing Tkinter in Windows
Tkinter comes with the Python installer. We just need to install Python from www.python.org, and it comes along with the Python. We don't need to install it separately. Click on the checkbox of tcl/tk and IDE.

Comments

Submit
0 Comments

More Questions

cmd cant change directoryhow to open d drive using conda prompt how to add basic authentication on haproxy backend server
cmd cd not workingvideo player html express hello world
form submit with file upload in phpcreate latex document button avalonia
simple deployment diagram for basic crud operationsc# sockets guzzlehttp authorization basic
using axios get with authorizationpehkui mod forge c# restclient get basic authentication
curl authJASON WEB TOKENS EM VBNET COM WINDOWS FORMS git commands
c64 basic define variableauthentication in fetch post how to create authentication and authorization in local api angular 14
basic array questionsc++ code snippets what are the 3 basic types of plate boundaries explain their differences (how they act).
pandas column statisticshow to make a calculator in python pygame window
raylib c# basic windowsmall basic textwindow npm err! code e401 npm err! unable to authenticate, need: basic realm=https:--pkgsprodeus21.pkgs.visualstudio.com-
split a column in google sheetshow to serve html file in node.js vba check if range is empty
create route in laravel 8golang http post authentication lib in tsconfig
range recursion javascriptvbs error message how to make an exit button using vs code
how to delete a value from document in mongodbvb.net remove case sensitivity face recognition python opencv haar cascade
curl to upload to artifactoryunity simple movement script node-fetch auth
basic symbol meanings in c++visual basic variable declaration visual basic run command